﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace MMS.Api.Helper
{
    public class OperationContext
    {
        static OperationContext opeContext = null;
        #region 1.0 操作上下文对象 +OperationContext Current
        /// <summary>
        /// 操作上下文对象
        /// </summary>
        public static OperationContext Current
        {
            get
            {
                if (opeContext == null)
                {
                    opeContext = new OperationContext();
                    
                }
                return opeContext;
            }
        }
        #endregion


        //-------------------业务仓储 属性 ------------------
    
        IService.IServiceSession _bllSession = null;
        #region 1.0 业务仓储 +IServiceSession BLLSession
        /// <summary>
        /// 1.0 业务仓储 
        /// </summary>
        public  IService.IServiceSession BLLSession
        {
            get
            {
                //1.如果为空
                if (_bllSession == null)
                {
                    //2.实例化 业务仓储 对象
                    _bllSession = Utility.DI.GetObject<IService.IServiceSession>("bllSession");
                }
                //3.返回业务仓储对象
                return _bllSession;
            }
        }
        #endregion
    }
}